{extend name='admin@main'}

{block name="button"}
<button data-open='{:url("purchase/add")}' data-msg="请选择预警商品"  data-title="添加商品" class='layui-btn layui-btn-sm layui-btn-primary'>生成订货单
</button>
{/block}

{block name="content"}
    <!--{notempty name='list'}-->
    <table class="layui-table notevent" lay-skin="line">
        <caption class="margin-bottom-10 text-left">{include file='red_goods/index_search'}</caption>
        <thead>
        <tr>
            <th class='list-table-check-td think-checkbox'>
                <input data-auto-none="none" data-check-target='.list-check-box' type='checkbox'>
            </th>
            <th class="nowrap">品名</th>
            <th class="nowrap">所属门店</th>
            <th class="padding-none">库存</th>
            <th class="padding-none">预警库存</th>
            <th class="padding-none">库存上限</th>
            <th class='text-center'>操作</th>
        </tr>
        </thead>
        <!--{/notempty}-->
        <tbody>
        {foreach $list as $key=>$vo}
        <tr>
            <td class='list-table-check-td text-top think-checkbox'>
                <input class="list-check-box" value='{$vo.productsn}' type='checkbox'>
            </td>
            <td class="text-left nowrap text-top">
                {$vo.title}
            </td>
            <td class="text-left nowrap text-top">
                {$vo.merchname}
            </td>
            <td class="text-left nowrap text-top">
                {$vo.total}
            </td>
            <td class="text-left nowrap text-top">
                {$vo.red}
            </td>
            <td class='text-left nowrap text-top'>
                {$vo.uperlimit}
            </td>

            <td class='text-center nowrap text-top'>
                <!--{if auth("edit")}-->
                <span class="text-explode">|</span>
                <a data-dbclick class="layui-btn layui-btn-sm" data-open='{:url("edit")}?id={$vo.productsn}'>编辑</a>
                <!--{/if}-->
            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>
    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}

<script>
    (function () {
        window.form.render();
        window.laydate.render({range: true, elem: '#create_at'});
    })();
</script>
{/block}